<%@page contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="bean"  uri="/WEB-INF/struts-bean.tld"%>
<%@ taglib prefix="html"  uri="/WEB-INF/struts-html.tld"%>
<%@ taglib prefix="logic" uri="/WEB-INF/struts-logic.tld"%>
<%@ taglib prefix="c"     uri="http://java.sun.com/jstl/core"%>
<%@ taglib prefix="fmt"   uri="http://java.sun.com/jstl/fmt"%>
<%@ taglib prefix="str"   uri="/WEB-INF/taglibs-string.tld"%>
<%@page import="com.antbee.cost.engineer.tools.*"%>
<script language="JavaScript">
  function gotoPaginatedPage(path, page, pageSize) {
    document.forms[0].action+=path+"&pageSize="+pageSize+"&page="+page; 
    document.forms[0].submit();
}
</script>
<style>
<!--
A {
	FONT-SIZE: 12px; COLOR: #000000; FONT-FAMILY: "宋体"; TEXT-DECORATION: underline
}
A:link {
	FONT-SIZE: 12px; COLOR: #000000; FONT-FAMILY: "宋体"; TEXT-DECORATION: underline
}
A:visited {
	FONT-SIZE: 12px; COLOR: #000000; FONT-FAMILY: "宋体"; TEXT-DECORATION: underline
}
A:active {
	FONT-SIZE: 12px; COLOR: #000000; FONT-FAMILY: "宋体"; TEXT-DECORATION: underline
}
A:hover {
	FONT-SIZE: 12px; COLOR: #800080; FONT-FAMILY: "宋体"; TEXT-DECORATION: none
}
-->
</style>
<%
String param=(request.getParameter("param") == null || (request.getParameter("param").trim()).equals("null") )? "" : request.getParameter("param").trim();
PaginatedArrayList pArrayList=(PaginatedArrayList)request.getAttribute("paginated_list");
if(pArrayList != null) {
int paginated_pages = pArrayList.getPages();
int paginated_currentPage = pArrayList.getCurrentPage();
int paginated_pageSize = pArrayList.getPageSize();
%>
<table border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td style="height:1"></td>
	</tr>
</table>
<%if (param.equals("1")) {%>
<TABLE border="0" cellpadding="0" cellspacing="1" >
	<TBODY>
		<TR>
			<TD>
			<TABLE width="100%" border=0 cellpadding=0 cellspacing=0>
			    <input type="hidden" name="pageSize" value="50"/>
				<TBODY>
					<TR>						
						<TD width="100%" nowrap class="paginate">&nbsp;&nbsp;&nbsp; 
						    页次<%=((paginated_pages==0) ? 0 : paginated_currentPage)%>/<%=paginated_pages%>
						    共<bean:write name="paginated_list" property="size" />条							
							<%if (paginated_currentPage >1) {%><a
							href="javascript:gotoPaginatedPage('',1,'<%=paginated_pageSize%>');"><%}%>首页</a>&nbsp;<%
							if(paginated_currentPage>1){%><a href="#"
							onclick="gotoPaginatedPage('','<%=(paginated_currentPage-1)%>','<%=paginated_pageSize%>');"><%}%>前一页</a>&nbsp;<%
							if(paginated_currentPage<paginated_pages) {
							%><a href="#"
							onclick="gotoPaginatedPage('','<%=(paginated_currentPage+1)%>','<%=paginated_pageSize%>');"><%}
							%>下一页</a>&nbsp;<%if(paginated_currentPage<paginated_pages){%><a
							href="#"
							onclick="gotoPaginatedPage('','<%=paginated_pages%>','<%=paginated_pageSize%>');"><%}
							%>最后一页</a>&nbsp;&nbsp;&nbsp;&nbsp; 
							转到第
							<SELECT name="page" onchange="gotoPaginatedPage('',this.value,'<%=paginated_pageSize%>');">
								<% for (int i = 1; i <= paginated_pages; i++) {%>
								<OPTION value="<%=i%>" <%=((i==paginated_currentPage) ? " selected" : "")%>><%=i%></OPTION>
								<%}%>
							</select> 页
							
						</TD>						
					</TR>
				</TBODY>
			</TABLE>
			</TD>
		</TR>
	</TBODY>
</TABLE>
<%}%>

<%}%>
